<template>
    <div class="mix">
        <div class="con">
            <div class="top">
                <span class="btn" @click="getInto">&lt;</span>
                <span class="nav">严选列表</span>
            </div>
            <div class="content-con" v-for="(item,index) in special" :key="index" @click="specialDetails(item.id)">
                <img :src="item.pic" alt="">
                <p class="p1">{{item.title}}</p>
                <p class="p2">{{item.descript}}</p>
                <p class="p3">查看详情</p>
            </div>
        </div>
    </div>
</template>

<script>
    import {
        mapState
    } from 'vuex'
    export default {

        computed: {
            ...mapState({
                special: state => state.homeSwiper.specialList
            })
        },
        methods: {
            getInto() {
                this.$router.push({
                    path: '/'
                })
            },
            specialDetails(id) {
                // this.$store.dispatch('specialDetails',id)
                // console.log(id)
                this.$router.push({
                    path: '/specialXiang',
                    query: {
                        id: id
                    }
                })
            }

        }
    }
</script>

<style lang='scss' scoped>
.mix{
    width: 100%;
    height: 100vh;
    overflow: scroll;
    .con{
        width: 100%;
    }
}
    .top {
        width: 100%;
        height: 1rem;
        line-height: 1rem;
        font-size: 0.4rem;
        overflow: hidden;
        span {
            display: inline-block;
        }

        .btn {
            width: 1rem;
            height: 1rem;
            text-align: center;
        }

        .nav {
            margin-left: 2rem;
        }
    }

    .content-con {
        width: 100%;
        height: 4rem;
        margin-top: 0.1rem;
        position: relative;
        border: 0.001rem solid white;

        img {
            width: 100%;
            height: 100%;
            position: absolute;
            z-index: -1;
        }

        p {
            color: white;
            text-align: center;
            width: 80%;
            margin: 0 auto;
        }

        .p1 {
            font-size: 0.35rem;
            margin-top: 1rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .p2 {
            font-size: 0.3rem;
            margin-top: 0.3rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .p3 {
            margin-top: 0.3rem;
            width: 30%;
            border-radius: 0.3rem;
            border: 0.01rem solid white;
            font-size: 0.35rem;
        }
    }
</style>